// WITH_STDLIB
// WITH_REFLECT
// IGNORE_KLIB_RUNTIME_ERRORS_WITH_CUSTOM_SECOND_STAGE: 2.2.0
// ^^^ KT-79704 is fixed in 2.3.0-Beta1, see improved `equals()` in kotlin.reflect.js.internal.KTypeParameterImpl, commit 4bdbc543
// ^^^ Illegal value: <T>
//     at assertNotEquals

import kotlin.test.*
import kotlin.reflect.*

fun <T> bar1() = typeOf<List<T>>()
fun <T> bar2() = typeOf<List<T>>()

class D {
    fun <T> bar1() = typeOf<List<T>>()
}

fun box(): String {
    val t1 = bar1<Int>().arguments.single().type!!.classifier
    val t2 = bar2<Int>().arguments.single().type!!.classifier
    val t3 = D().bar1<Int>().arguments.single().type!!.classifier
    assertNotEquals(t1, t2)
    assertNotEquals(t1, t3)
    assertNotEquals(t2, t3)
    assertEquals(t1, bar1<Int>().arguments.single().type!!.classifier)
    assertEquals(t2, bar2<Int>().arguments.single().type!!.classifier)
    assertEquals(t3, D().bar1<Int>().arguments.single().type!!.classifier)

    return "OK"
}
